using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Export_ExportStudentsForPlacementTypeToExcel : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.gvAllocatedStudents.DataSource = this.odsAllocatedStudents;
        this.gvAllocatedStudents.DataBind();

        string filename = "StudentsForVenues_" + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + ".xls";

        Response.Clear();
        Response.AddHeader("content-disposition", "attachment;filename=" + filename);
        Response.ContentType = "application/vnd.ms-excel";
        Response.Charset = "";
        this.EnableViewState = false;
        System.IO.StringWriter sw = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(sw);
        this.gvAllocatedStudents.RenderControl(hw);
        Response.Write(sw.ToString());
        Response.End();
    }

    public override void VerifyRenderingInServerForm(Control control)
    {

        // Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time.

    }

}
